﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterCustomerLogin.master" AutoEventWireup="true" CodeBehind="GoodsOrderLogin.aspx.cs" Inherits="Project_Udrinkwater.CustomerLogin.GoodsOrderLogin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <dx:ASPxRoundPanel ID="RPN_GoodsOrderlogin" runat="server" Width="100%" 
        HeaderText="รายการสินค้า">
        <HeaderStyle Font-Size="Medium" HorizontalAlign="Left" />
        <PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
    <div></div>
    <div align="center">
        <dx:ASPxDataView ID="DataViewGoods" runat="server" 
            SettingsTableLayout-RowsPerPage="2" Width="1100px" PagerAlign="Justify" ItemSpacing="25px"
        DataSourceID="SqlDataSource_ShowOrder" ForeColor="Black" 
            onitemcommand="DataViewGoods_ItemCommand" >
        <ItemTemplate>
             <table style="margin: 0 auto;">
                <tr>
                    <td colspan="2" align="center" style="text-align: center">
                        <dx:ASPxImage ID="imgCover" runat="server" ImageUrl='<%# Eval("Image") %>' Width="150px" Height="150px" ShowLoadingImage="true" /> 
                    </td>
                </tr>
                 <tr>
                    <td style="text-align: right"><b>รหัสสินค้า:</b></td>
                    <td><dx:ASPxLabel ID="lblName" runat="server"  Text='<%# Eval("Product_ID") %>' /></td>
                </tr>
                 <tr>
                    <td style="text-align: right"><b>ชื่อสินค้า:</b></td>
                    <td><dx:ASPxLabel ID="lblAddress" runat="server" Text='<%# Eval("Product_Name") %>' /></td>
                </tr>
                 <tr>
                    <td style="text-align: right"><b>ราคาขาย:</b></td>
                    <td><dx:ASPxLabel ID="lblPrice" runat="server" Text='<%# Eval("Price") %>' /></td>
                </tr>
                 <tr>
                    <td style="text-align: right"><b>หน่วยการขาย:</b></td>
                    <td><dx:ASPxLabel ID="lb_Unit" runat="server" Text='<%# Eval("Unit_Name") %>' /></td>
                </tr>
                 <tr>
                    <td style="text-align: right"><b>จำนวน:</b></td>
                    <td>
                        <table style="width: 100%">
                            <tr>
                                <td>
                                    <dx:ASPxTextBox ID="Tb_Price" runat="server" Width="50px" MaxLength="6" >
                                        <ClientSideEvents KeyDown="function(s, e) {
	if (!((e.htmlEvent.keyCode &gt;= 48 &amp;&amp; e.htmlEvent.keyCode &lt;= 57) || 
           (e.htmlEvent.keyCode == 8 || e.htmlEvent.keyCode == 46 || e.htmlEvent.keyCode == 37 || 
            e.htmlEvent.keyCode == 39))) 
        ASPxClientUtils.PreventEventAndBubble(e.htmlEvent);   
}" />
                                        <ValidationSettings ErrorDisplayMode="None">
                                        </ValidationSettings>
                                    </dx:ASPxTextBox>
                                </td>
                                <td>
                                    <dx:ASPxButton ID="bt_Confirm" runat="server" 
                                        CommandArgument='<%# Eval("Product_ID") %>' CommandName="Cmd" Text="สั่งซื้อ" 
                                        Width="70px" />
                                </td>
                            </tr>
                        </table>
                     </td>
                </tr>
            </table>
        </ItemTemplate>
            <PagerSettings Position="Bottom">
            </PagerSettings>
    </dx:ASPxDataView>
    <asp:SqlDataSource ID="SqlDataSource_ShowOrder" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
            
            SelectCommand="SELECT *, TB_Product.Product_ID AS Expr1, TB_Product.Product_Name AS Expr2, TB_Product.Image AS Expr3, TB_Order_Category.Price AS Expr4, TB_Unit_Category.Unit_Name AS Expr5 FROM TB_Product INNER JOIN TB_Unit_Category ON TB_Product.Product_Unit = TB_Unit_Category.Unit_ID INNER JOIN TB_Order_Category ON TB_Product.Product_ID = TB_Order_Category.Product_ID
WHERE TB_Order_Category.Order_Category_Name = 'ขายปลีก' AND TB_Product.Product_Category_ID='01'"></asp:SqlDataSource>
   </div>
</dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>
</asp:Content>
